package com.tinytoon.hunghoaqua;

import java.util.HashMap;

import com.tinytoon.hunghoaqua.R;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.AudioManager;
import android.media.SoundPool;

public class GameRes {
	public static HashMap<String, Integer> mapCharsAndSounds = new HashMap<String, Integer>();
	public static SoundPool soundPool = new SoundPool(7,
			AudioManager.STREAM_MUSIC, 0);

	public static void loadSound(Context context) {
		// LowerCase and UpperCase have the same sound
		//mapCharsAndSounds.put("y", soundPool.load(context, R.raw.y, 0));
		// mapCharsAndSounds.put("z", soundPool.load(context, R.raw.z, 0));
	}

	public static Bitmap getBitmap(Resources res, String aChar) {
		Bitmap result = null;
		if (aChar.equals("jump right"))
			result = BitmapFactory.decodeResource(res, R.drawable.mario15);
		else if (aChar.equals("jump left"))
			result = BitmapFactory.decodeResource(res, R.drawable.mario_left15);
		else if (aChar.equals("stand left"))
			result = BitmapFactory.decodeResource(res, R.drawable.mario_left22);
		else if (aChar.equals("stand right"))
			result = BitmapFactory.decodeResource(res, R.drawable.mario22);
		else if (aChar.equals("peach"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_peach);
		else if (aChar.equals("ananas"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_ananas);
		else if (aChar.equals("apple1"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_apple_1);
		else if (aChar.equals("apple2"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_apple_2);
		else if (aChar.equals("apricot"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_apricot);
		else if (aChar.equals("banana1"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_banana_1);
		else if (aChar.equals("banana2"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_banana_2);
		else if (aChar.equals("banana3"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_banana_3);
		else if (aChar.equals("shoe1"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_shoe_1);
		else if (aChar.equals("cake"))
			result = BitmapFactory.decodeResource(res, R.drawable.ic_cake);
		else if (aChar.equals("score minus"))
			result = BitmapFactory.decodeResource(res, R.drawable.score_minus);
		else if (aChar.equals("score plus"))
			result = BitmapFactory.decodeResource(res, R.drawable.score_plus);
		else if (aChar.equals("ball"))
			result = BitmapFactory.decodeResource(res, R.drawable.ball);
		else if (aChar.equals("score minus 2"))
			result = BitmapFactory
					.decodeResource(res, R.drawable.score_minus_2);
		else if (aChar.equals("box plus 1"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_plus1);
		else if (aChar.equals("box plus 2"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_plus2);
		else if (aChar.equals("box plus 3"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_plus3);
		else if (aChar.equals("box plus 4"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_plus4);
		else if (aChar.equals("plus 5"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_5);
		else if (aChar.equals("plus 10"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_10);
		else if (aChar.equals("plus 20"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_20);
		else if (aChar.equals("plus 50"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_50);
		else if (aChar.equals("box time 5"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_time_5);
		else if (aChar.equals("box time 10"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_time10);
		else if (aChar.equals("box time 20"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_time_20);
		else if (aChar.equals("plus time 5"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_time_5);
		else if (aChar.equals("plus time 10"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_time_10);
		else if (aChar.equals("plus time 20"))
			result = BitmapFactory.decodeResource(res, R.drawable.plus_time_20);
		else if (aChar.equals("box bomb"))
			result = BitmapFactory.decodeResource(res, R.drawable.box_bomb);
		return result;
	}

	public static Bitmap[] getBitmapsLeft(Resources res){
		Bitmap animationLeft[] = {
				BitmapFactory.decodeResource(res, R.drawable.mario_left1),
				BitmapFactory.decodeResource(res, R.drawable.mario_left2),
				BitmapFactory.decodeResource(res, R.drawable.mario_left3),
				BitmapFactory.decodeResource(res, R.drawable.mario_left4),
				BitmapFactory.decodeResource(res, R.drawable.mario_left5),
				BitmapFactory.decodeResource(res, R.drawable.mario_left6),
				BitmapFactory.decodeResource(res, R.drawable.mario_left7),
				BitmapFactory.decodeResource(res, R.drawable.mario_left8),
				BitmapFactory.decodeResource(res, R.drawable.mario_left9),
				BitmapFactory.decodeResource(res, R.drawable.mario_left10),
				BitmapFactory.decodeResource(res, R.drawable.mario_left11),
				BitmapFactory.decodeResource(res, R.drawable.mario_left12),
				BitmapFactory.decodeResource(res, R.drawable.mario_left13),
				BitmapFactory.decodeResource(res, R.drawable.mario_left14),
				BitmapFactory.decodeResource(res, R.drawable.mario_left15),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left16),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left17),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left18),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left19),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left20),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left21),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left22),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left23),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left24),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left25),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left26),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left27),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left28),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left29),
//				BitmapFactory.decodeResource(res, R.drawable.mario_left30)
		};
		return animationLeft;
	}
	
	public static Bitmap[] getBitmapsRight(Resources res){
		Bitmap animationRight[] = {
				BitmapFactory.decodeResource(res, R.drawable.mario1),
				BitmapFactory.decodeResource(res, R.drawable.mario2),
				BitmapFactory.decodeResource(res, R.drawable.mario3),
				BitmapFactory.decodeResource(res, R.drawable.mario4),
				BitmapFactory.decodeResource(res, R.drawable.mario5),
				BitmapFactory.decodeResource(res, R.drawable.mario6),
				BitmapFactory.decodeResource(res, R.drawable.mario7),
				BitmapFactory.decodeResource(res, R.drawable.mario8),
				BitmapFactory.decodeResource(res, R.drawable.mario9),
				BitmapFactory.decodeResource(res, R.drawable.mario10),
				BitmapFactory.decodeResource(res, R.drawable.mario11),
				BitmapFactory.decodeResource(res, R.drawable.mario12),
				BitmapFactory.decodeResource(res, R.drawable.mario13),
				BitmapFactory.decodeResource(res, R.drawable.mario14),
				BitmapFactory.decodeResource(res, R.drawable.mario15),
//				BitmapFactory.decodeResource(res, R.drawable.mario16),
//				BitmapFactory.decodeResource(res, R.drawable.mario17),
//				BitmapFactory.decodeResource(res, R.drawable.mario18),
//				BitmapFactory.decodeResource(res, R.drawable.mario19),
//				BitmapFactory.decodeResource(res, R.drawable.mario20),
//				BitmapFactory.decodeResource(res, R.drawable.mario21),
//				BitmapFactory.decodeResource(res, R.drawable.mario22),
//				BitmapFactory.decodeResource(res, R.drawable.mario23),
//				BitmapFactory.decodeResource(res, R.drawable.mario24),
//				BitmapFactory.decodeResource(res, R.drawable.mario25),
//				BitmapFactory.decodeResource(res, R.drawable.mario26),
//				BitmapFactory.decodeResource(res, R.drawable.mario27),
//				BitmapFactory.decodeResource(res, R.drawable.mario28),
//				BitmapFactory.decodeResource(res, R.drawable.mario29),
//				BitmapFactory.decodeResource(res, R.drawable.mario30)
		};
		return animationRight;
	}
}
